﻿<?xml version="1.0" encoding="UTF-8" ?>
<sqlMap namespace="ibatisnet" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
  <statements>
  
    <insert id="UserLogic_Insert" parameterClass="Portal.Entity.UserEntity" >
      INSERT INTO COM_USER
      (
      USERID, USERCODE, CNNAME, ENNAME, LOGINNAME,  EMAIL, MOBILENO, TEL,
      QQ, PASSWORD, PICTURE, REQUIRECHANGEPASSWORD, ORDERNO, CREATEDATE, CREATEBY, UPDATEDATE, UPDATEBY, EFFECTFROM,
      EFFECTTO, ISACTIVE, EXT01, EXT02, EXT03, EXT04, EXT05, EXT06, EXT07, EXT08, EXT09, EXT10, EXT11, EXT12, EXT13, EXT14, EXT15, EXT16,
      EXT17, EXT18, EXT19, EXT20, EXT21, EXT22, EXT23, EXT24, EXT25, EXT26, EXT27, EXT28, EXT29, EXT30
      )
      VALUES(
      #USERID#,#USERCODE#,#CNNAME#,#ENNAME#,#LOGINNAME#,#EMAIL#,#MOBILENO#,#TEL#,#
      QQ#,#PASSWORD#,#PICTURE#,#REQUIRECHANGEPASSWORD#,#ORDERNO#,#CREATEDATE#,#CREATEBY#,#UPDATEDATE#,#UPDATEBY#,#EFFECTFROM#,#
      EFFECTTO#,#ISACTIVE#,#EXT01#,#EXT02#,#EXT03#,#EXT04#,#EXT05#,#EXT06#,#EXT07#,#EXT08#,#EXT09#,#EXT10#,#EXT11#,#EXT12#,#EXT13#,#EXT14#,#EXT15#,#EXT16#,#
      EXT17#,#EXT18#,#EXT19#,#EXT20#,#EXT21#,#EXT22#,#EXT23#,#EXT24#,#EXT25#,#EXT26#,#EXT27#,#EXT28#,#EXT29#,#EXT30#
      )
    </insert>

    <update id="UserLogic_Update" parameterClass="Portal.Entity.UserEntity" >
      UPDATE COM_USER SET
      USERCODE=#USERCODE#, CNNAME=#CNNAME#, ENNAME=#ENNAME#, LOGINNAME=#LOGINNAME#,  EMAIL=#EMAIL#, MOBILENO=#MOBILENO#, TEL=#TEL#,
      QQ=#QQ#, PASSWORD=#PASSWORD#, PICTURE=#PICTURE#, REQUIRECHANGEPASSWORD=#REQUIRECHANGEPASSWORD#, ORDERNO=#ORDERNO#,
      CREATEDATE=#CREATEDATE#, CREATEBY=#CREATEBY#, UPDATEDATE=#UPDATEDATE#, UPDATEBY=#UPDATEBY#, EFFECTFROM=#EFFECTFROM#,
      EFFECTTO=#EFFECTTO#, ISACTIVE=#ISACTIVE#, EXT01=#EXT01#, EXT02=#EXT02#, EXT03=#EXT03#, EXT04=#EXT04#, EXT05=#EXT05#, EXT06=#EXT06#,
      EXT07=#EXT07#, EXT08=#EXT08#, EXT09=#EXT09#, EXT10=#EXT10#, EXT11=#EXT11#,
      EXT12=#EXT12#, EXT13=#EXT13#, EXT14=#EXT14#, EXT15=#EXT15#, EXT16=#EXT16#,
      EXT17=#EXT17#, EXT18=#EXT18#, EXT19=#EXT19#, EXT20=#EXT20#, EXT21=#EXT21#,
      EXT22=#EXT22#, EXT23=#EXT23#, EXT24=#EXT24#, EXT25=#EXT25#, EXT26=#EXT26#, EXT27=#EXT27#, EXT28=#EXT28#, EXT29=#EXT29#, EXT30=#EXT30#
      WHERE USERID=#USERID#
    </update>

    <delete id="UserLogic_Delete">
      UPDATE COM_USER SET ISACTIVE=0 WHERE USERID=#USERID#
    </delete>

    <insert id="UserLogic_InsertJob" parameterClass="Portal.Entity.JobEntity" >
      INSERT INTO COM_JOB
      (
      JOBID, USERID, DEPARTMENTID, JOBFUNCTION, JOBGRADE, DIRECTREPORTID, ISMANAGER, ISPRIMARY, EXT01, EXT02, EXT03, EXT04,
      EXT05
      )
      VALUES(
      #JOBID#, #USERID#, #DEPARTMENTID#, #JOBFUNCTION#, #JOBGRADE#, #DIRECTREPORTID#, #ISMANAGER#, #ISPRIMARY#, #EXT01#, #EXT02#, #EXT03#, #EXT04#,
      #EXT05#
      )
    </insert>

    <update id="UserLogic_UpdateJob" parameterClass="Portal.Entity.JobEntity" >
      UPDATE COM_JOB SET
      JOBID=#JOBID#, USERID=#USERID#, DEPARTMENTID=#DEPARTMENTID#, JOBFUNCTION=#JOBFUNCTION#, JOBGRADE=#JOBGRADE#, DIRECTREPORTID=#DIRECTREPORTID#,
      ISMANAGER=#ISMANAGER#, ISPRIMARY=#ISPRIMARY#, EXT01=#EXT01#, EXT02=#EXT02#, EXT03=#EXT03#, EXT04=#EXT04#, EXT05=#EXT05#
      WHERE JOBID=#JOBID#
    </update>

    <delete id="UserLogic_DeleteJob">
      DELETE FROM COM_JOB WHERE JOBID=#JOBID#
    </delete>
    
  </statements>
</sqlMap>